From f9a8f54704e2cfadf770aae475325d4dd5548313 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 8 Jun 2006 13:59:34 +0000 Subject: [PATCH] Give GtkToolButton the same treatment. 2006-06-08 Matthias Clasen * gtk/gtktoolbutton.c (gtk_tool_button_style_set): Give GtkToolButton the same treatment. --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ gtk/gtktoolbutton.c | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31cb9c38ca..34b9db7ebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-06-08 Matthias Clasen + * gtk/gtktoolbutton.c (gtk_tool_button_style_set): Give + GtkToolButton the same treatment. + * gtk/gtkbutton.c (gtk_button_style_set): Don't call construct_child here, since some apps make assumptions about the lifecycle of the constructed label. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 31cb9c38ca..34b9db7ebc 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2006-06-08 Matthias Clasen + * gtk/gtktoolbutton.c (gtk_tool_button_style_set): Give + GtkToolButton the same treatment. + * gtk/gtkbutton.c (gtk_button_style_set): Don't call construct_child here, since some apps make assumptions about the lifecycle of the constructed label. diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index f52e23aac3..ae9c7ad550 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -665,11 +665,27 @@ gtk_tool_button_toolbar_reconfigured (GtkToolItem *tool_item) gtk_tool_button_construct_contents (tool_item); } +static void +gtk_tool_button_update_icon_spacing (GtkToolButton *button) +{ + GtkWidget *box; + guint spacing; + + box = GTK_BIN (button->priv->button)->child; + if (GTK_IS_BOX (box)) + { + gtk_widget_style_get (GTK_WIDGET (button), + "icon-spacing", &spacing, + NULL); + gtk_box_set_spacing (GTK_BOX (box), spacing); + } +} + static void gtk_tool_button_style_set (GtkWidget *widget, GtkStyle *prev_style) { - gtk_tool_button_construct_contents (GTK_TOOL_ITEM (widget)); + gtk_tool_button_update_icon_spacing (GTK_TOOL_BUTTON (widget)); } /** -- 2.30.2